package com.zja.service.impl;

import com.zja.mapper.GradeMapper;
import com.zja.pojo.Grade;
import com.zja.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GradeServiceImpl implements GradeService {
    @Autowired
    private GradeMapper classMapper;
    /**
     * 获取班级列表
     */
    public List<Grade> getGradeList(String id,String name) {
        List<Grade> list = classMapper.getGradeList(id,name);
        System.out.println(1111);
        return list;
    }

    /**
     * 添加班级
     * @param gradeId 班级id
     * @param gradeName 班级名
     * @return
     */
    public boolean add(String gradeId, String gradeName) {
       int result = classMapper.add(gradeId,gradeName);
        System.out.println(result+"sss");
       return result>0;
    }

    /**
     * 删除班级
     * @param gradeId 班级id
     * @return
     */
    public boolean del(String gradeId) {
        int result = classMapper.del(gradeId);
        return result>0;
    }
}
